package com.gestocasa.view.views.helper;

import java.util.Vector;

import javax.swing.table.DefaultTableModel;

public class CustomTableModel extends DefaultTableModel {
	
	private Vector<Object> dataList;
	
	public CustomTableModel() {
		super();
		dataList = new Vector<Object>();
	}
	
	public Object getRowData(int a) {
		if(a >= 0 && a < dataList.size()) {
			return dataList.get(a);
		}
		return null;
	}
	
	public void addRow(Vector<Object> a, Object data) {
		super.addRow(a);
		dataList.add(data);
	}
	
	public void addRow(Object[] a, Object data) {
		super.addRow(a);
		dataList.add(data);
	}
	
	@Override
	public void removeRow(int a) {
		super.removeRow(a);
		if(a < dataList.size()) {
			dataList.remove(a);	
		}
	}
	
	@Override
	public boolean isCellEditable(int arg0, int arg1) {
		return false;
	}
	
}
